import { useStore } from '@renderer/store/useStore'

export default function useShortcut() {
  const setError = useStore((state) => state.setError)
  async function register(type: string, shortCut: string) {
    const isRegister = await window.api.shortCut(type, shortCut)
    if (!isRegister) {
      setError('当前快捷键已定义')
    }
  }

  return {
    register
  }
}
